package com.neuedu.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

//@Component //告诉容器扫描的时候，此类是一个Bean
@Controller
public class UserController {

    @Autowired //依赖注入
    private UserService userService ;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    public void save(){
        System.out.println("UserController.save");
        userService.save();
    }



}
